<script setup>
import { useI18n } from 'vue-i18n'
import { useRouter } from "vue-router"
import Header from "@/components/Header.vue"
import LanguageCell from "@/components/LanguageCell.vue"
const { locale } = useI18n();
const router = useRouter();
const language = (lang) => {
    locale.value = lang;
    console.log(locale.value);
    localStorage.setItem('language', lang);
    router.go(-1);
}
</script>
<template>
    <div class="languagePage">

        <Header title="Language"></Header>
        <div class="border-b border-gray-200">
            <LanguageCell title="简体中文" @click="language('zh')" />

            <LanguageCell title="English" @click="language('en')" />

            <LanguageCell title="ไทย" @click="language('th')" />

            <LanguageCell title="日文" @click="language('ja')" />

            <LanguageCell title="한국인" @click="language('ko')" />

            <LanguageCell title="Tiếng Việt" @click="language('vi')" />
        </div>


    </div>
</template>
